package com.jmz.apt.api.dao;

import com.jmz.apt.api.dto.impl.AdminTokenDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by fanglexue on 2019/10/28.
 */
@Mapper
public interface TokenDao {
    /**
     * Obtain permissions of role
     * @return
     */
    @Select("select u.status status, u.id adminId,u.name name,ur.role_id roleId from jmz_admin_user as u left join jmz_admin_user_roles" +
            " as ur on u.id = ur.admin_id where u.id = #{id}")
    public List<AdminTokenDto> findAdminUserAsRoleByAdminId(Integer id);
}
